<{include file="db:`$dirname`_header.html"}>

<div id="saleListContent">

<{if $messeage && $buyMileId && $buyMile}>
  <table border="0" cellspacing="0" id="buyBox"><tr>
    <td class="message">
      <{$buyMileId|intval}> : <{$buyMile->getShow('name')}><br />
      <{$buyMile->getShow('url')}>
      <hr color="#DD6699" />
      <{$messeage|xoops_escape}>
    </td>
    <td class="submitButton">
      <div>
        <span class="minusMile">
        <{$buyMile->getShow('point')}> <{$smarty.const._MD_MILEAGE_LANG_POINT}>
        </span>
        <form action="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/index.php?action=RecEdit" method="post">
          <{xoops_token form=$actionForm}>
          <{xoops_input type=hidden name=gotourl value=1}>
          <{xoops_input type=hidden name=mile_id value=$buyMileId|intval}>
          <{xoops_input type=hidden name=rec_id value=0}>
          <{xoops_input type=hidden name=uid value=$uid}>
          <{xoops_input type=hidden name=reg_unixtime value=0}>
          <{xoops_input type=hidden name=point value=$buyMile->getShow('point')}>
          <{xoops_input type=hidden name=dirname value=$dirname}>
          <input type="submit" value="<{$smarty.const._MD_MILEAGE_LANG_REC_BUY}>" <{if $totalPoint < $buyMile->get('point')|abs}>disabled="DISABLED"<{/if}> />
        </form>
      </div>
    </td>
  </tr></table>
<{/if}>


<div id="mileage_totalpoint">
  <p>
    <{$smarty.const._MD_MILEAGE_LANG_CURRENT_MILEAGE}><br />
    <span style="font-size:200%;line-height:100%;"><{$totalPoint|intval}></span><br />
    <span><{$smarty.const._MD_MILEAGE_LANG_POINT}></span>
  </p>
</div>


<h3><{$smarty.const._MD_MILEAGE_LANG_SALE_LIST}></h3>

<div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>

<table class="outer">
  <thead>
    <tr>
      <th>
        <{$smarty.const._MD_MILEAGE_LANG_MILE_ID}><br />
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=<{$smarty.const.MILEAGE_MILE_SORT_KEY_MILE_ID}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/up.gif" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=-<{$smarty.const.MILEAGE_MILE_SORT_KEY_MILE_ID}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/down.gif" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a>
      </th>
      <th>
        <{$smarty.const._MD_MILEAGE_LANG_NAME}><br />
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=<{$smarty.const.MILEAGE_MILE_SORT_KEY_NAME}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/up.gif" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=-<{$smarty.const.MILEAGE_MILE_SORT_KEY_NAME}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/down.gif" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a>
      </th>
      <th>
        <{$smarty.const._MD_MILEAGE_LANG_POINT}><br />
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=<{$smarty.const.MILEAGE_MILE_SORT_KEY_POINT}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/up.gif" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=-<{$smarty.const.MILEAGE_MILE_SORT_KEY_POINT}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/down.gif" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a>
      </th>
      <th>
        <{$smarty.const._MD_MILEAGE_LANG_REG_UNIXTIME}><br />
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=<{$smarty.const.MILEAGE_MILE_SORT_KEY_REG_UNIXTIME}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/up.gif" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}><{if $getQuery}>&amp;<{else}>?<{/if}><{$pageNavi->getPrefix()}>sort=-<{$smarty.const.MILEAGE_MILE_SORT_KEY_REG_UNIXTIME}>"><img src="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/images/down.gif" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a>
      </th>
      <th><{$smarty.const._MD_MILEAGE_LANG_CONTROL}></th>
    </tr>
  </thead>
  <tbody>
    <{foreach item=obj from=$objects}>
      <tr class="<{cycle values='odd,even'}>">
        <td><{$obj->getShow('mile_id')}></td>
        <td>
          <{if $obj->get('url')|strpos:$smarty.const.XOOPS_URL === 0 && $obj->get('url')|mileage_url_check}>
            <a href="<{$obj->getShow('url')}>"><{$obj->getShow('name')}></a>
          <{else}>
            <{$obj->getShow('name')}>
          <{/if}>
        </td>
        <td><{$obj->getShow('point')}></td>
        <td><{$obj->get('reg_unixtime')|xoops_formattimestamp:l}></td>
        <td class="sallist_control">
          <{if $obj->canBuy}>
          <form action="<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/index.php?action=RecEdit" method="post">
            <{xoops_token form=$actionForm}>
            <{xoops_input type=hidden name=mile_id value=$obj->getShow('mile_id')}>
            <{xoops_input type=hidden name=rec_id value=0}>
            <{xoops_input type=hidden name=uid value=$uid}>
            <{xoops_input type=hidden name=reg_unixtime value=0}>
            <{xoops_input type=hidden name=point value=$obj->getShow('point')}>
            <{xoops_input type=hidden name=dirname value=$dirname}>
            <input type="submit" value="<{$smarty.const._MD_MILEAGE_LANG_REC_BUY}>" <{if $totalPoint < $obj->get('point')|abs}>disabled="DISABLED"<{/if}> />
          </form>
          <{/if}>
        </td>
      </tr>
    <{/foreach}>
  </tbody>
</table>

<div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>

</div><{* <!--end of #saleListContent--> *}>

<{include file="db:`$dirname`_footer.html"}>
